<html>
<head><meta charset="utf-8"><title>What is delay_span_bug for? · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/What.20is.20delay_span_bug.20for.3F.html">What is delay_span_bug for?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="223193849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/What%20is%20delay_span_bug%20for%3F/near/223193849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/What.20is.20delay_span_bug.20for.3F.html#223193849">(Jan 19 2021 at 07:21)</a>:</h4>
<p>This function seems really hacky and it's not documented. What does it do and when should I use it?</p>



<a name="223193904"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/What%20is%20delay_span_bug%20for%3F/near/223193904" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/What.20is.20delay_span_bug.20for.3F.html#223193904">(Jan 19 2021 at 07:22)</a>:</h4>
<p><span class="user-mention" data-user-id="119169">@osa1</span> it means "ICE if no error is reported". It's meant to ensure the compiler doesn't try to keep going when the code is broken past repair</p>



<a name="223193932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/What%20is%20delay_span_bug%20for%3F/near/223193932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/What.20is.20delay_span_bug.20for.3F.html#223193932">(Jan 19 2021 at 07:23)</a>:</h4>
<p>this is the reason I had to add <code>EmitIgnoredResolutionErrors</code> in rustdoc: <a href="https://github.com/rust-lang/rust/blob/94e6ea9fc97845b336067bffb3d103780474f6f5/src/librustdoc/core.rs#L637-L641">https://github.com/rust-lang/rust/blob/94e6ea9fc97845b336067bffb3d103780474f6f5/src/librustdoc/core.rs#L637-L641</a></p>



<a name="223193945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/What%20is%20delay_span_bug%20for%3F/near/223193945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/What.20is.20delay_span_bug.20for.3F.html#223193945">(Jan 19 2021 at 07:23)</a>:</h4>
<p>Hmm, so the compiler tries to make progress as much as possible, even in the presence of errors, so we collect the errors but still make progress. When progress is not possible instead of panicking we do <code>delay_span_bug</code> which stops compilation and reports existing errors?</p>



<a name="223194009"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/What%20is%20delay_span_bug%20for%3F/near/223194009" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/What.20is.20delay_span_bug.20for.3F.html#223194009">(Jan 19 2021 at 07:24)</a>:</h4>
<p>delay_span_bug does not stop compilation. It panics when the TyCtxt is dropped I think.</p>



<a name="223194022"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/What%20is%20delay_span_bug%20for%3F/near/223194022" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/What.20is.20delay_span_bug.20for.3F.html#223194022">(Jan 19 2021 at 07:25)</a>:</h4>
<p>Why does this function take a span argument? It seems like the message passed to this function is not used (at least in some cases). I used it in <a href="https://github.com/rust-lang/rust/issues/81185">#81185</a> and my error message is not used.</p>



<a name="223194025"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/What%20is%20delay_span_bug%20for%3F/near/223194025" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/What.20is.20delay_span_bug.20for.3F.html#223194025">(Jan 19 2021 at 07:25)</a>:</h4>
<p>the idea is that there is not context at the current point to give a useful error, so it depends on other parts of the compiler to give errors</p>



<a name="223194109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/What%20is%20delay_span_bug%20for%3F/near/223194109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/What.20is.20delay_span_bug.20for.3F.html#223194109">(Jan 19 2021 at 07:26)</a>:</h4>
<p>the error message is not used because other errors were reported</p>



<a name="223194119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/What%20is%20delay_span_bug%20for%3F/near/223194119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/What.20is.20delay_span_bug.20for.3F.html#223194119">(Jan 19 2021 at 07:26)</a>:</h4>
<p>delay_span_bug only emits the error if no other errors are reported</p>



<a name="223194132"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/What%20is%20delay_span_bug%20for%3F/near/223194132" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/What.20is.20delay_span_bug.20for.3F.html#223194132">(Jan 19 2021 at 07:27)</a>:</h4>
<p>Interesting.. That makes sense, thanks <span class="user-mention" data-user-id="232545">@Joshua Nelson</span></p>



<a name="223447446"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/What%20is%20delay_span_bug%20for%3F/near/223447446" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/What.20is.20delay_span_bug.20for.3F.html#223447446">(Jan 20 2021 at 22:41)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/What.20is.20delay_span_bug.20for.3F/near/223194009">said</a>:</p>
<blockquote>
<p>delay_span_bug does not stop compilation. It panics when the TyCtxt is dropped I think.</p>
</blockquote>
<p>Wait, but <code>TyCtxt</code> is Copy so I don't think it can have a Drop impl...</p>



<a name="223448956"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/What%20is%20delay_span_bug%20for%3F/near/223448956" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/What.20is.20delay_span_bug.20for.3F.html#223448956">(Jan 20 2021 at 22:56)</a>:</h4>
<p><span class="user-mention" data-user-id="307537">@Camelid</span> sorry, I meant GlobalCtxt</p>



<a name="223448984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/What%20is%20delay_span_bug%20for%3F/near/223448984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/What.20is.20delay_span_bug.20for.3F.html#223448984">(Jan 20 2021 at 22:57)</a>:</h4>
<p>TyCtxt is a pointer to GlobalCtxt</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>